package com.mxpio.erp.common.plan.entity;

import com.mxpio.erp.common.jpa.model.BizOrder;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.Dept;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * @Author : 吴盼盼
 * @Datetime : 2022/12/10 10:36
 * @Desc :  组织需求 主表
 * @Modor :  Modifytime:
 * @modDesc :
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PLAN_OD")
@Schema(description="组织需求")
public class OrganizationDemand extends BizOrder {

    private static final long serialVersionUID = 1L;

    @Column(name = "DEMAND_TYPE_")
    @Schema(description = "需求类型")
    @Dict(dicCode = "ERP_SALES_DEMAND_TYPE")
    private String demandType;

    @Column(name = "DEMAND_ORG_")
    @Schema(description = "需求组织")
    @Dict(dicCode = "deptCode", dicEntity = Dept.class, dicText = "deptName")
    private String demandOrg;

    @Column(name = "SUPPLY_ORG_")
    @Schema(description = "供应组织")
    @Dict(dicCode = "deptCode", dicEntity = Dept.class, dicText = "deptName")
    private String supplyOrg;

    @Column(name = "APPLY_MAN_")
    @Schema(description = "申请人")
    private String applyMan;

    @Column(name = "APPLY_DEPT_")
    @Schema(description = "申请部门")
    @Dict(dicCode = "deptCode", dicEntity = Dept.class, dicText = "deptName")
    private String applyDept;

    @Column(name = "MEMO_")
    @Schema(description = "备注")
    private String memo;

    @Transient
    @Schema(description = "组织需求明细行")
    private List<OrganizationDemandLine> organizationDemandLineList;

    @Override
    public String initTypeCode() {
        return "OD1";
    }

    @Column(name = "USAGE_")
    @Schema(description = "用途")
    @Dict(dicCode = "ERP_SALES_DEMAND_USAGE")
    private String usage;

    /*@Column(name = "AUDIT_OPINION_")
    @Schema(description = "审核意见")
    private String auditOpinion;*/
}
